package com.javaAPI.demo5;

public class Test {
    public static void main(String[] args) {
        Animal cat = new Cat();
        //对象的引用 instanceof 具体的类型
        if(cat instanceof Dog){
            Dog dog = (Dog)cat;
            System.out.println("类型一致");

        }else {
            System.out.println("类型不一致");
        }

    }
}
